#ifndef BaseService_h
#define BaseService_h

#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/bio.h>

#include <Winsock2.h>

#include "User.h"
#include "Thread.h"

#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "libeay32.lib")
#pragma comment(lib, "ssleay32.lib")

class CSSLBaseService{
	public:
		CSSLBaseService();
		~CSSLBaseService();
		bool initialize();
		void run();

	public:
		void execute();

	private:
		BIO * m_bio;
		SSL * m_ssl;
		SSL_METHOD * m_meth;
		SSL_CTX * m_ctx;
		
		WSADATA WSAData;

	public:
		bool Connect();
		int Send(char * buf, int len);
		int Receive(char * buf, int len);
		
};

#endif
